<?php
namespace App\Api\Requests;

use Illuminate\Validation\Rule;

class GetOptionsRequest extends BaseRequest{
    public function authorize(){
        return true;
    }

    public function rules(){
        $repositories = new \App\Api\Repositories\OptionRepositories;
        $types = $repositories->get_types();
        return [
            'type' => ['required', Rule::in(array_merge(['all', 'birthday'], array_keys($types)))],
        ];
    }

    public function messages(){
        return [
            'type.required'=> '请选择选项类型',
            'type.in'=> '没有此选项类型',
        ];
    }
}